#include<iostream>
#include<cstring>
using namespace std;
const int N = 110;
char g[N][N];
bool st[N][N];
int n, t;
int xa, xb, ya, yb;
int dx[] = { 0,-1,0,1 }, dy[] = { -1,0,1,0 };
bool dfs(int x, int y)
{
    if (g[x][y] == '#') return false;
    if (x == xb && y == yb) return true;
    st[x][y] = true;
    for (int i = 0; i < 4; i++)
    {
        int a = x + dx[i], b = y + dy[i];
        if (a < 0 || a >= n || b < 0 || b >= n) continue;
        if (st[a][b]) continue;
        if (dfs(a, b)) return true;
    }
    return false;
}
int main()
{
    cin >> t;
    while (t--)
    {
        memset(st, false, sizeof st);
        cin >> n;
        for (int i = 0; i < n; i++) cin >> g[i];
        cin >> xa >> ya >> xb >> yb;
        if (dfs(xa, ya)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}